<template>
  <div id="app">
    <router-view></router-view>
  </div>
</template>

<script>
import { mapState } from 'vuex'
import Layout from './BasicLayout'
export default {
  name: 'app',
  beforeCreate () {
    console.log('booting')
  },
  components: {
    Layout
  },
  computed: {
    ...mapState({
      logged: state => state.app.logged_in
    })
  },
  watch: {
    logged (val) {
      if (!val) {
        this.$router.replace({
          name: 'login'
          // params: {
          //   message: '登录超时，请重新登录'
          // }
        })
      }
    }
  }
}
</script>

<style>
#app {
  font-family: 'Avenir', Helvetica, Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;

  /* color: #2c3e50; */
  /* margin-top: 60px; */

  height: 100vh;
}
</style>
